package practice4;

import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;

public class QQListDemo {

	public static void main(String[] args) {
		String[] strs = { "1235545", "674591", "44347809933", "12765432102", "167891", "2347809933", "674591" };

		List list = new LinkedList();

		Collections.addAll(list, strs);

		System.out.println("原list："+list);

		Set set = new HashSet(list);
//		System.out.println(set);

		list = new LinkedList(set);
		System.out.println("删除重复元素后："+list);

		System.out.println("增强for循环：");
		for (Object o : list) {
			System.out.print(o + " ");
		}
		System.out.println("\n迭代器：");
		Iterator iterator = list.iterator();
		while (iterator.hasNext()) {
			System.out.print(iterator.next()+" ");
		}

	}

}
